package targetToOffer.thirteenthDay;

/**
 * @author Godc
 * @description
 */
public class MaxDepth {
}
class MaxDepthSolution{
    public int height(TreeNode root){
        if(root==null) return 0;
        int left = height(root.left);
        int right = height(root.right);
        return Math.max(left,right)+1;
    }
}
 class TreeNode {
      int val;
      TreeNode left;
      TreeNode right;
      TreeNode(int x) { val = x; }
  }